<template>
  <div>
    <CropperUpload
      :imageUrl="coverUrl"
      :options="coverOptions"
      @avatarfn="coverUrlFn"
      avatarText="支持jpg, gif, png格式的图片, 建议最小尺寸480x270，大小不能超过2M"
    />
  </div>
</template>
<script>
import CropperUpload from "./components/Upload/CropperUpload.vue";
export default {
  data() {
    return {
      form: {},
      coverUrl: "",
      coverOptions: {
        autoCrop: true, //是否默认生成截图框
        autoCropWidth: 480, //默认生成截图框宽度
        autoCropHeight: 270, //默认生成截图框高度
        fixedBox: true, //是否固定截图框大小 不允许改变
        previewsCircle: false, //预览图是否是原圆形
        title: "修改图片",
      },
    };
  },
  created() {},
  mounted() {},
  methods: {
    coverUrlFn(id, url) {
      this.coverUrl = url;
      this.form.coverId = id;
    },
  },
  components: {
    CropperUpload,
  },
};
</script>
